
#include <Arduino.h>
#include <WiFi.h>

//绑定两个灯
#define REDLED1 12 // WIFI开始连接，亮灯，连接成功后，灯灭
#define REDLED2 13 // WIFI开始连接，亮灯，连接成功后，灯灭


const char *ssid = "tgy";
const char *password = "wifi112358";
#define I2C_SDA 4 //传感器I2C使用的管脚
#define I2C_SCL 5
void setup()
{
  Serial.begin(115200);

  pinMode(REDLED1, OUTPUT);
  pinMode(REDLED2, OUTPUT);

  //Wire.begin(I2C_SDA, I2C_SCL);

  Serial.println("Adafruit AHT10 demo!");
  WiFi.begin(ssid, password);
  Serial.println();
  Serial.print("WIFI Connecting");
  delay(1000);
  digitalWrite(REDLED1, !digitalRead(REDLED1));
  digitalWrite(REDLED2, !digitalRead(REDLED2));
  delay(1000);
  digitalWrite(REDLED1, !digitalRead(REDLED1));
  digitalWrite(REDLED2, !digitalRead(REDLED2));

  while (WiFi.status() != WL_CONNECTED)
  {delay(300);
    digitalWrite(REDLED1, !digitalRead(REDLED1));
  }
}

void loop()
{
  delay(1000);
  //digitalWrite(REDLED1, !digitalRead(REDLED1));
  digitalWrite(REDLED2, !digitalRead(REDLED2));
}
